<?php
if (!defined('IN_ZWS')) exit();

class AddSubjectModel extends Model {
	protected $tableName = 'Group_Subject';
	protected $_validate = array(
		array('cname', 'require', '科目名不能为空！', 1),
		array('cname', 'checklen', '科目名长度过长！', 1, 'callback'),
		array('cname', '', '科目名已存在！', 1, 'unique'),
		);

	function checklen($data) {
		return strlen($data) > 10 ? false:true;
	}

}
